using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_TableDescriptionMap : EntityTypeConfiguration<t_TableDescription>
    {
        public t_TableDescriptionMap()
        {
            // Primary Key
            this.HasKey(t => t.FTableID);

            // Properties
            this.Property(t => t.FTableID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FTableName)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(80);

            this.Property(t => t.FDescription)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(255);

            this.Property(t => t.FTableNote)
                .IsFixedLength()
                .HasMaxLength(255);

            this.Property(t => t.FDescription_Cht)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FDescription_En)
                .IsRequired()
                .HasMaxLength(510);

            this.Property(t => t.FTableNote_Cht)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FTableNote_En)
                .IsRequired()
                .HasMaxLength(510);

            // Table & Column Mappings
            this.ToTable("t_TableDescription");
            this.Property(t => t.FSubSystemID).HasColumnName("FSubSystemID");
            this.Property(t => t.FTableID).HasColumnName("FTableID");
            this.Property(t => t.FTableName).HasColumnName("FTableName");
            this.Property(t => t.FDescription).HasColumnName("FDescription");
            this.Property(t => t.FTableNote).HasColumnName("FTableNote");
            this.Property(t => t.FType).HasColumnName("FType");
            this.Property(t => t.FSefDefSign).HasColumnName("FSefDefSign");
            this.Property(t => t.FDescription_Cht).HasColumnName("FDescription_Cht");
            this.Property(t => t.FDescription_En).HasColumnName("FDescription_En");
            this.Property(t => t.FTableNote_Cht).HasColumnName("FTableNote_Cht");
            this.Property(t => t.FTableNote_En).HasColumnName("FTableNote_En");
        }
    }
}
